using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bxas.Core;
using System.Xml.Serialization;
using PhotoHsn.BLL.Abstracts;
using PhotoHsn.BLL.Adapters;
using PhotoHsn.BLL.Core;

namespace PhotoHsn.BLL.Adapters
{
    [XmlType(Namespace = "urn:DataObjects")]
    [XmlRoot(Namespace = "urn:DataObjects")]
    [Serializable]
    public class EquipmentTypes : ColumnInfo
    {
        public EquipmentTypes()
        {
            this.priymatyKeyColumnName = "Id";
            this.priymatyKeyColumnType = typeof(System.Byte);
            this.TableName = "EquipmentTypes";
        }

        #region Fields
		private byte id = 0;
		private string equipmentType = string.Empty;
		private bool isActive = false;
		private bool isDeleted = false;

        #endregion
        
        #region Properties
 
		///<summary>
		///Required = true
		///DBType = tinyint identity
		///C# Type = byte
		///</summary> 
		[ColumnAttributes("Id",true,"byte")]
		public byte Id
		{
			 get 
			 {
			    return id;
			 }
			 set 
			 { 
			    if (value != id)
			    { 
			      id = value; 
			      if (!IsUpdateOrInsert.ContainsKey(EquipmentTypes.ColumnNames.Id))
			      IsUpdateOrInsert.Add(EquipmentTypes.ColumnNames.Id, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		[ColumnAttributes("EquipmentType",true,"string")]
		public string EquipmentType
		{
			 get 
			 {
			    return equipmentType;
			 }
			 set 
			 { 
			    string valueTrimmed = value.Trim(); 

			    if (valueTrimmed != equipmentType)
			    { 
			      equipmentType = valueTrimmed; 
			      if (!IsUpdateOrInsert.ContainsKey(EquipmentTypes.ColumnNames.EquipmentType))
			      IsUpdateOrInsert.Add(EquipmentTypes.ColumnNames.EquipmentType, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bit
		///C# Type = bool
		///</summary> 
		[ColumnAttributes("IsActive",true,"bool")]
		public bool IsActive
		{
			 get 
			 {
			    return isActive;
			 }
			 set 
			 { 
			    if (value != isActive)
			    { 
			      isActive = value; 
			      if (!IsUpdateOrInsert.ContainsKey(EquipmentTypes.ColumnNames.IsActive))
			      IsUpdateOrInsert.Add(EquipmentTypes.ColumnNames.IsActive, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bit
		///C# Type = bool
		///</summary> 
		[ColumnAttributes("IsDeleted",true,"bool")]
		public bool IsDeleted
		{
			 get 
			 {
			    return isDeleted;
			 }
			 set 
			 { 
			    if (value != isDeleted)
			    { 
			      isDeleted = value; 
			      if (!IsUpdateOrInsert.ContainsKey(EquipmentTypes.ColumnNames.IsDeleted))
			      IsUpdateOrInsert.Add(EquipmentTypes.ColumnNames.IsDeleted, true); 
			      this.IsDirty = true; 
			    }
			 }
		}

        #endregion
		        
        #region StringProperties
 
		///<summary>
		///Required = true
		///DBType = byte
		///C# Type = byte
		///</summary> 
		public virtual string s_Id
		{
			 get 
			 {
			        return Gettinyint_s(id);
			 }
			 set 
			 { 
			        Settinyint_s(value, ref id);
			      if (!IsUpdateOrInsert.ContainsKey(EquipmentTypes.ColumnNames.Id))
			        IsUpdateOrInsert.Add(EquipmentTypes.ColumnNames.Id, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = string
		///C# Type = string
		///</summary> 
		public virtual string s_EquipmentType
		{
			 get 
			 {
			        return Getnvarchar_s(equipmentType);
			 }
			 set 
			 { 
			        Setnvarchar_s(value, ref equipmentType);
			      if (!IsUpdateOrInsert.ContainsKey(EquipmentTypes.ColumnNames.EquipmentType))
			        IsUpdateOrInsert.Add(EquipmentTypes.ColumnNames.EquipmentType, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bool
		///C# Type = bool
		///</summary> 
		public virtual string s_IsActive
		{
			 get 
			 {
			        return Getbit_s(isActive);
			 }
			 set 
			 { 
			        Setbit_s(value, ref isActive);
			      if (!IsUpdateOrInsert.ContainsKey(EquipmentTypes.ColumnNames.IsActive))
			        IsUpdateOrInsert.Add(EquipmentTypes.ColumnNames.IsActive, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bool
		///C# Type = bool
		///</summary> 
		public virtual string s_IsDeleted
		{
			 get 
			 {
			        return Getbit_s(isDeleted);
			 }
			 set 
			 { 
			        Setbit_s(value, ref isDeleted);
			      if (!IsUpdateOrInsert.ContainsKey(EquipmentTypes.ColumnNames.IsDeleted))
			        IsUpdateOrInsert.Add(EquipmentTypes.ColumnNames.IsDeleted, true);
			        this.IsDirty = true;
			 }
		}

        #endregion

		#region ColumnNames
        public class ColumnNames
        {
		public const string Id = "Id";
		public const string EquipmentType = "EquipmentType";
		public const string IsActive = "IsActive";
		public const string IsDeleted = "IsDeleted";

        }
        #endregion
    }
}

namespace PhotoHsn.BLL.Abstracts
{
    public class _EquipmentTypesBs : BaseBs
    {
		public Boolean insert(EquipmentTypes p) { return this._insert<EquipmentTypes>(p); }
        public Boolean update(EquipmentTypes p) { return this._update<EquipmentTypes>(p); }
        public Boolean delete(EquipmentTypes p) { return this._delete<EquipmentTypes>(p); }
        public List<EquipmentTypes> get(string sql) { return this._get<EquipmentTypes>(sql); }
        public List<EquipmentTypes> get(System.Data.SqlClient.SqlCommand sqlcommand) { return this._get<EquipmentTypes>(sqlcommand); }
		public List<EquipmentTypes> get_all(List<string> columnNames) { return this._get_all<EquipmentTypes>(columnNames); }
        public List<EquipmentTypes> get_all_with_all_columns() { return this._get_all_with_all_columns<EquipmentTypes>(); }
		public EquipmentTypes get_by_primarykey(System.Byte pk, List<string> columnNames) { return this._get_by_primarykey<EquipmentTypes>(pk, columnNames); }
    }
}
